<template>
  <div class="son-page-container" :style="{ backgroundImage: `url(${website_bg_url})` }">
    <el-container class="main-container">
      <el-header height="10vh" class="header-container">
        <MyHeader />
      </el-header>
      <el-main>
        <el-row :gutter="20">
          <el-col :span="24">
            <div class="area-container right-area">
              <div class="lab-main">
                <div class="lab-left">
                  <div class="month-row">
                    <div
                        class="month-item"
                        v-for="m in 12"
                        :key="m"
                        :class="{ active: selectedMonth === m, disabled: isMonthDisabled(m) }"
                        @click="!isMonthDisabled(m) && handleMonthChange(m)"
                    >
                      {{ m }}月
                    </div>
                  </div>
                  <div class="left-second-row">
                    <div class="left-second-half left-second-left">
                      <div class="section-title">创作力排行榜</div>
                      <!-- 前三名固定区域 -->
                      <div class="rank-top-section">
                        <!-- 加载状态 -->
                        <div v-if="isLoading" class="loading-container">
                          <div class="loading-spinner"></div>
                          <div class="loading-text">加载中...</div>
                        </div>
                        <!-- 第一名 -->
                        <div class="rank-top1" v-if="createRankList.length > 0">
                          <div class="rank-top-item rank-1" @click="handleViewList('mb_build_stastic',createRankList[0])">
                            <div class="rank-badge">1</div>
                            <div class="avatar-wrapper">
                              <div class="initials">{{ getFirstChar(createRankList[0]?.store_name || '未知用户') }}</div>
                            </div>
                            <div class="rank-top-name">
                              <span class="crown-icon">👑</span>
                              {{ createRankList[0]?.store_name || '未知用户' }}
                            </div>
                            <div class="rank-top-score">
                              <div class="score-label">创作</div>
                              <div class="score-number">{{ createRankList[0]?.build_cnt || 0 }}个</div>
                            </div>
                          </div>
                        </div>
                        <!-- 第二、三名 -->
                        <div class="rank-top23" v-if="createRankList.length > 1">
                          <div class="rank-top-item rank-2" v-if="createRankList[1]" @click="handleViewList('mb_build_stastic',createRankList[1])">
                            <div class="rank-badge">2</div>
                            <div class="avatar-wrapper">
                              <div class="initials">{{ getFirstChar(createRankList[1]?.store_name || '未知用户') }}</div>
                            </div>
                            <div class="rank-top-name">
                              <span class="crown-icon silver">👑</span>
                              {{ createRankList[1].store_name?createRankList[1].store_name:'未知用户' }}
                            </div>
                            <div class="rank-top-score">
                              <div class="score-label">创作</div>
                              <div class="score-number">{{ createRankList[1]?.build_cnt || 0 }}个</div>
                            </div>
                          </div>
                          <div class="rank-top-item rank-3" v-if="createRankList[2]" @click="handleViewList('mb_build_stastic',createRankList[2])">
                            <div class="rank-badge">3</div>
                            <div class="avatar-wrapper">
                              <div class="initials">{{ getFirstChar(createRankList[2]?.store_name || '未知用户') }}</div>
                            </div>
                            <div class="rank-top-name">
                              <span class="crown-icon bronze">👑</span>
                              {{ createRankList[2].store_name?createRankList[2].store_name:'未知用户' }}
                            </div>
                            <div class="rank-top-score">
                              <div class="score-label">创作</div>
                              <div class="score-number">{{ createRankList[2]?.build_cnt || 0 }}个</div>
                            </div>
                          </div>
                        </div>
                        <!-- 无数据状态 -->
                        <div v-if="!isLoading && createRankList.length === 0" class="no-data-container">
                          <div class="no-data-text">暂无数据</div>
                        </div>
                      </div>
                      <!-- 其他排名滚动区域 -->
                      <div class="rank-list" v-if="!isLoading">
                        <div class="rank-item" v-for="(item, index) in createRankList.slice(3)" :key="item.id" @click="handleViewList('mb_build_stastic',item)">
                          <div class="rank-left">
                            <span class="rank-index">{{ index + 4 }}</span>
                            <span class="rank-name">{{ item.store_name?item.store_name:'未知用户' }}</span>
                          </div>
                          <div class="rank-score">
                            <span class="score-number">{{ item.build_cnt || 0 }}个</span>
                          </div>
                        </div>
                      </div>
                    </div>
                    <div class="left-second-half left-second-right">
                      <div class="section-title">影响力排行榜</div>
                      <!-- 前三名固定区域 -->
                      <div class="rank-top-section">
                        <!-- 加载状态 -->
                        <div v-if="isLoading" class="loading-container">
                          <div class="loading-spinner"></div>
                          <div class="loading-text">加载中...</div>
                        </div>
                        <!-- 第一名 -->
                        <div class="rank-top1" v-if="useRankList.length > 0">
                          <div class="rank-top-item rank-1" @click="handleViewList('mb_used_stats',useRankList[0])">
                            <div class="rank-badge">1</div>
                            <div class="avatar-wrapper">
                              <div class="initials">{{ getFirstChar(useRankList[0]?.store_name || '未知用户') }}</div>
                            </div>
                            <div class="rank-top-name">
                              <span class="crown-icon">👑</span>
                              {{ useRankList[0]?.store_name || '未知用户' }}
                            </div>
                            <div class="rank-top-score">
                              <div class="score-label">被使用</div>
                              <div class="score-number">{{ useRankList[0]?.quote_cnt || 0 }}次</div>
                            </div>
                          </div>
                        </div>
                        <!-- 第二、三名 -->
                        <div class="rank-top23" v-if="useRankList.length > 1">
                          <div class="rank-top-item rank-2" v-if="useRankList[1]" @click="handleViewList('mb_used_stats',useRankList[1])">
                            <div class="rank-badge">2</div>
                            <div class="avatar-wrapper">
                              <div class="initials">{{ getFirstChar(useRankList[1]?.store_name || '未知用户') }}</div>
                            </div>
                            <div class="rank-top-name">
                              <span class="crown-icon silver">👑</span>
                              {{ useRankList[1].store_name?useRankList[1].store_name:'未知用户' }}
                            </div>
                            <div class="rank-top-score">
                              <div class="score-label">被使用</div>
                              <div class="score-number">{{ useRankList[1]?.quote_cnt || 0 }}次</div>
                            </div>
                          </div>
                          <div class="rank-top-item rank-3" v-if="useRankList[2]" @click="handleViewList('mb_used_stats',useRankList[2])">
                            <div class="rank-badge">3</div>
                            <div class="avatar-wrapper">
                              <div class="initials">{{ getFirstChar(useRankList[2]?.store_name || '未知用户') }}</div>
                            </div>
                            <div class="rank-top-name">
                              <span class="crown-icon bronze">👑</span>
                              {{ useRankList[2].store_name?useRankList[2].store_name:'未知用户' }}
                            </div>
                            <div class="rank-top-score">
                              <div class="score-label">被使用</div>
                              <div class="score-number">{{ useRankList[2]?.quote_cnt || 0 }}次</div>
                            </div>
                          </div>
                        </div>
                        <!-- 无数据状态 -->
                        <div v-if="!isLoading && useRankList.length === 0" class="no-data-container">
                          <div class="no-data-text">暂无数据</div>
                        </div>
                      </div>
                      <!-- 其他排名滚动区域 -->
                      <div class="rank-list" v-if="!isLoading">
                        <div class="rank-item" v-for="(item, index) in useRankList.slice(3)" :key="item.id" @click="handleViewList('mb_used_stats',item)">
                          <div class="rank-left">
                            <span class="rank-index">{{ index + 4 }}</span>
                            <span class="rank-name">{{ item.store_name?item.store_name:'未知用户' }}</span>
                          </div>
                          <div class="rank-score">{{ item.quote_cnt || 0 }}次</div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
                <div class="lab-middle">
                  <div class="section-title">热门模版</div>
                  <div class="template-list">
                    <div class="template-item" v-for="template in hotTemplates" :key="template.template_id" @click="handleTemplateClick(template)">
                      <div class="template-rank">{{ template.rank }}</div>
                      <div class="template-meta">
                        <div class="template-name">{{ template.template_name }}</div>
                        <div class="template-categories">
                          <span class="first-category">{{ template.first_category }}</span>
                          <span class="second-category">{{ template.second_category }}</span>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
                <div class="lab-right">
                  <div class="section-title">快速入口</div>
                  <div class="quick-entry">
                    <div class="quick-item"><div class="quick-btn" @click="goToCreate">去创作</div></div>
<!--                    <div class="quick-item"><div class="quick-btn" @click="goToTalk">论坛</div></div>-->
                  </div>
                </div>
              </div>
            </div>
          </el-col>
        </el-row>
      </el-main>
    </el-container>
    <MyDialog
        v-model="showViewVideoDialog"
        title="预览视频"
        width="50%"
        :modal="true"
        :close-on-click-modal="false"
        @confirm="handleViewVideoConfirm"
        @cancel="handleViewVideoCancel"
    >
      <div class="video-preview-content">
        <!-- 空内容区域 -->
        <VideoShow :videoJsonData="videoJsonData" ref="videoShowRef"/>
      </div>
    </MyDialog>

    <el-drawer
        v-model="drawer"
        :title="drawerTitle"
        :direction="direction"
        :before-close="handleClose"
    >
      <div class="drawer-content">
        <div class="data-list">
          <div
            class="data-item"
            v-for="item in drawerData"
            :key="item.id"
            @click="handleDrawerClick(item)"
          >
            {{ item.title }}
          </div>
        </div>
      </div>
    </el-drawer>
  </div>
</template>

<script setup lang="ts">
import {onMounted, ref} from 'vue'
import axiosUtil from '../../axios-util/axios-util'
import {ArrowDown} from '@element-plus/icons-vue'
import FollowNote from '../laboratory/FollowNote.vue'
import LinkToMindMap from '../laboratory/LinkToMindMap.vue'
import LinkToNote from '../laboratory/LinkToNote.vue'
import PictureToNote from '../laboratory/PictureToNote.vue';
import MyHeader from '../common/MyHeader.vue';
import VideoShow from "./VideoShow.vue";
import MyDialog from "../common/MyDialog.vue";
import LocalStorageUtil from "../../utils/LocalStorageUtil.ts";
const drawer = ref(false)
const direction = ref('rtl')
const drawerTitle = ref("")
const drawerData = ref([])
const handleClose = (done: () => void) => {
  drawer.value = false
  drawerData.value = []
  drawerTitle.value = ""
}
const handleViewList = async (functionName: string,itemData: any) =>{
  drawer.value = true
  const title = functionName==='mb_used_stats'?'影响力排行榜':'创作力排行榜'
  drawerTitle.value = title + '           ' + itemData.store_name + '的作品'
  console.log( drawerTitle.value)
  const currentYear = new Date().getFullYear()
  const period = `${currentYear}-${selectedMonth.value.toString().padStart(2, '0')}`
  const url = 'api/stastic/' + functionName + '/getTemplateListByAuthor?period=' + period + '&builder=' + itemData.builder
  const responsePost = await axiosUtil.get(url)
  if(responsePost.data.code ===1){
    drawerData.value = responsePost.data.data
  }
  console.log(itemData.builder)
}

const handleDrawerClick = (itemData: any) =>{
  showViewVideoDialog.value = true
  videoJsonData.value = "https://zhjh168.com/aijianji/#/detail/"+itemData.project_id
  console.log(videoJsonData.value)
  videoShowRef.value?.openThisPage()
}

// 网站背景图
const website_bg_url = ref('')
// 网站logo
const website_logo = ref('')
// 本页菜单
const page_menu_list = ref([])

// 左侧月份选择
const selectedMonth = ref(new Date().getMonth())

// 排行榜数据
const createRankList = ref([])
const useRankList = ref([])
// 加载状态
const isLoading = ref(false)

// 截取字符串第一个字符的函数
const getFirstChar = (str: string): string => {
  return str ? str.charAt(0) : ''
}

const showViewVideoDialog = ref(false)
const videoShowRef = ref(null)
const videoJsonData = ref("")

const handleViewVideoConfirm = () => {
  showViewVideoDialog.value = false;
  // 在这里添加你的确认逻辑
  videoShowRef.value?.closeThisPage()
}

// 预览视频弹窗取消事件
const handleViewVideoCancel = () => {
  showViewVideoDialog.value = false;
  // 在这里添加你的取消逻辑
  videoShowRef.value?.closeThisPage()
}

// 处理模板点击事件
const handleTemplateClick = (template: any) => {
  console.log('模板被点击:', template)
  // 在这里添加您的点击事件处理逻辑
  // template.project_id
  showViewVideoDialog.value = true
  videoJsonData.value = "https://zhjh168.com/aijianji/#/detail/"+template.project_id
  videoShowRef.value?.openThisPage()
}

// 判断月份是否被禁用（当前月份及以后的月份禁用）
const isMonthDisabled = (month: number): boolean => {
  const currentMonth = new Date().getMonth() + 1
  return month >= currentMonth
}

const initChartsCreateData = async () => {
  const currentYear = new Date().getFullYear()
  const period = `${currentYear}-${selectedMonth.value.toString().padStart(2, '0')}`
  const url = `api/stastic/mb_build_stastic/getRankList?period=${period}`
  const responsePost = await axiosUtil.get(url)
  if (responsePost.data.code === 1 && responsePost.data.data) {
    createRankList.value = responsePost.data.data.rank_list || []
  }
}

const initChartsUseData = async () => {
  const currentYear = new Date().getFullYear()
  const period = `${currentYear}-${selectedMonth.value.toString().padStart(2, '0')}`
  const url = `api/stastic/mb_used_stats/getRankList?period=${period}`
  const responsePost = await axiosUtil.get(url)
  if (responsePost.data.code === 1 && responsePost.data.data) {
    useRankList.value = responsePost.data.data.rank_list || []
  }
}

const hotTemplates = ref([])

const initHottTemplate = async () => {
  const currentYear = new Date().getFullYear()
  const period = `${currentYear}-${selectedMonth.value.toString().padStart(2, '0')}`
  const url = `api/stastic/mb_hot_stastic/getHotTemplatesByMonth?period=${period}`
  const responsePost = await axiosUtil.get(url)
  if (responsePost.data.code === 1 && responsePost.data.data) {
    hotTemplates.value = responsePost.data.data.hot_templates || []
  }
}

// 同时获取两个排行榜数据
const initRankData = async () => {
  const currentYear = new Date().getFullYear()
  const period = `${currentYear}-${selectedMonth.value.toString().padStart(2, '0')}`

  const [createResponse, useResponse] = await Promise.all([
    axiosUtil.get(`api/stastic/mb_build_stastic/getRankList?period=${period}`),
    axiosUtil.get(`api/stastic/mb_used_stats/getRankList?period=${period}`)
  ])

  if (createResponse.data.code === 1 && createResponse.data.data) {
    createRankList.value = createResponse.data.data.rank_list || []
  }

  if (useResponse.data.code === 1 && useResponse.data.data) {
    useRankList.value = useResponse.data.data.rank_list || []
  }
}

// 处理月份变化
const handleMonthChange = async (month: number) => {
  selectedMonth.value = month

  // 先清空当前数据
  createRankList.value = []
  useRankList.value = []

  // 设置加载状态
  isLoading.value = true

  try {
    // 获取新数据
    await initRankData()
    await initHottTemplate()
  } catch (error) {
    console.error('获取排行榜数据失败:', error)
  } finally {
    // 无论成功失败都要关闭加载状态
    isLoading.value = false
  }
}

// tab切换相关
const tabList = [
  { key: 'pictureToNote', label: '图转笔记' },
  { key: 'followNote', label: '仿写笔记' },
  { key: 'linkToNote', label: '链接转笔记' },
  { key: 'linkToMindMap', label: '链接转思维导图' }
]
const activeTab = ref('pictureToNote')
const handleTabClick = (key: string) => {
  activeTab.value = key
}

// 切换菜单展开/收起
const toggleMenu = (menu: any) => {
  menu.isExpanded = !menu.isExpanded
}

// 处理子菜单点击
const handleChildClick = (child: any) => {
  console.log('子菜单点击:', child)
  // 这里添加子菜单点击的处理逻辑
}

// 去创作按钮点击事件
const goToCreate = () => {
  window.open('https://zhjh168.com/xiaozhu.php/store_intopieces?ref=addtabs', '_blank')
}

const goToTalk = () => {
  window.open('https://zhjh168.com/blog/cms/main/cmsIndex?code='+LocalStorageUtil.get('code'), '_blank')
}

onMounted(() => {
  initWebsiteBgUrl()
  initPageMenuList()
  initRankData()
  initHottTemplate()
})

//读取配置，获取网站背景图和网站logo
const initWebsiteBgUrl = async () => {
  const response = await axiosUtil.post('api/pc/site/get_agent_config', {})
  if (response.data.code === 0 && response.data.data) {
    website_bg_url.value = import.meta.env.VITE_APP_SERVER + response.data.data.website_bg || ''
    website_logo.value = import.meta.env.VITE_APP_SERVER + response.data.data.website_logo || ''
  }
}

// 获取本页菜单
const initPageMenuList = async () => {
  const response = await axiosUtil.post('api/storeintopieces/classifylist', {})
  if (response.data.code === 1 && response.data.data) {
    page_menu_list.value = response.data.data
  }
}
</script>

<style scoped>
.son-page-container {
  position: relative;
  width: 100%;
  min-height: 100vh;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.son-page-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 60% at 20% 20%, rgba(161,140,209,0.35) 0%, rgba(161,140,209,0.0) 60%) ,
  radial-gradient(50% 50% at 80% 30%, rgba(251,194,235,0.35) 0%, rgba(251,194,235,0.0) 55%),
  radial-gradient(40% 40% at 50% 80%, rgba(120,214,255,0.25) 0%, rgba(120,214,255,0.0) 60%);
  mix-blend-mode: screen;
  pointer-events: none;
  animation: auroraMove 18s ease-in-out infinite alternate;
}

.son-page-container::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
      to bottom,
      rgba(255,255,255,0.04) 0px,
      rgba(255,255,255,0.04) 1px,
      transparent 2px,
      transparent 4px
  );
  opacity: 0.35;
  pointer-events: none;
}

@keyframes auroraMove {
  0% { transform: translate3d(0,0,0) scale(1); filter: hue-rotate(0deg) saturate(110%); }
  100% { transform: translate3d(0,-2%,0) scale(1.02); filter: hue-rotate(25deg) saturate(120%); }
}

.main-container {
  height: 100vh;
  width: 100%;
  backdrop-filter: blur(5px);
}

.header-container {
  padding: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.el-main {
  padding: 20px;
  height: 90vh;
  overflow-x: hidden;
}

.el-row {
  height: 100%;
  margin: 0 !important;
}

.el-col {
  height: 100%;
}

.area-container {
  height: 100%;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  border: 1px solid rgba(161,140,209,0.25);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18), inset 0 0 0 1px rgba(255,255,255,0.06);
  transition: all 0.3s ease;
  padding: 15px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.area-container::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  padding: 1px;
  background: linear-gradient(120deg, rgba(161,140,209,0.5), rgba(251,194,235,0.4) 40%, rgba(120,214,255,0.4) 80%);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.55;
}

.lab-main {
  display: flex;
  flex-direction: row;
  height: 100%;
  min-height: 0;
  gap: 12px;
  width: 100%;
}
.lab-left,
.lab-middle,
.lab-right {
  height: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(161,140,209,0.25);
  border-radius: 12px;
  backdrop-filter: blur(6px);
  box-sizing: border-box;
  min-width: 0;
  position: relative;
}

.lab-left::after,
.lab-middle::after,
.lab-right::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: radial-gradient(60% 40% at 0% 0%, rgba(161,140,209,0.18), transparent 60%) ,
  radial-gradient(50% 35% at 100% 0%, rgba(120,214,255,0.14), transparent 60%);
  pointer-events: none;
}

.lab-left {
  flex: 1 1 70%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.left-second-row {
  display: flex;
  gap: 12px;
  padding: 12px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.left-second-half {
  flex: 1 1 50%;
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* 排行榜容器不超出父容器，并可滚动 */
.left-second-left,
.left-second-right {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* 前三名固定区域 */
.rank-top-section {
  flex: 0 0 auto;
  margin-bottom: 12px;
}

/* 其他排名滚动区域 */
.left-second-left .rank-list,
.left-second-right .rank-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 移除原来的rank-rest样式，因为现在直接使用rank-list */
.rank-rest {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rank-top1 {
  display: grid;
}

.rank-top23 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.rank-rest {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rank-top-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 0 10px;
  position: relative;
}

.avatar-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  border-radius: 50%;
  width: 80px;
  height: 80px;
}
/* 首字母样式 */
.initials {
  position: absolute;
  top: 60%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 16px;
  font-weight: bold;
  color: white;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* 皇冠装饰 */
.rank-1 .avatar-wrapper::before,
.rank-2 .avatar-wrapper::before,
.rank-3 .avatar-wrapper::before {
  content: '';
  position: absolute;
  top: -18px;
  width: 36px;
  height: 22px;
  background: currentColor;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 40"><path d="M6 34h52l-6-18-12 9-8-18-8 18-12-9-6 18z"/></svg>') center/contain no-repeat;
          mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 40"><path d="M6 34h52l-6-18-12 9-8-18-8 18-12-9-6 18z"/></svg>') center/contain no-repeat;
}

.rank-1 .avatar-wrapper { color: #ffb300; border: 2px solid #ffb300 !important;}
.rank-2 .avatar-wrapper { color: #cfcfcf; border: 2px solid #cfcfcf !important;}
.rank-3 .avatar-wrapper { color: #fb8c00; border: 2px solid #fb8c00 !important;}

/* 光环与荣誉环 */
.rank-1 .avatar-wrapper::after,
.rank-2 .avatar-wrapper::after,
.rank-3 .avatar-wrapper::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(255,255,255,0.0), rgba(255,255,255,0.9), rgba(255,255,255,0.0) 35%);
  animation: rotateGlow 3s linear infinite;
  filter: blur(0.6px);
  mix-blend-mode: screen;
  pointer-events: none;
}

.rank-1 .rank-top-avatar { box-shadow: 0 12px 28px rgba(0,0,0,0.35), 0 0 0 3px rgba(255, 215, 64, 0.45); }
.rank-2 .rank-top-avatar { box-shadow: 0 12px 28px rgba(0,0,0,0.35), 0 0 0 3px rgba(224, 224, 224, 0.45); }
.rank-3 .rank-top-avatar { box-shadow: 0 12px 28px rgba(0,0,0,0.35), 0 0 0 3px rgba(255, 171, 64, 0.45); }

@keyframes rotateGlow {
  to { transform: rotate(360deg); }
}

.rank-top-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 12px 28px rgba(0,0,0,0.3), 0 0 0 3px rgba(255,255,255,0.15);
}

.rank-1 .rank-top-avatar { width: 96px; height: 96px; }
.rank-2 .rank-top-avatar { width: 88px; height: 88px; }
.rank-3 .rank-top-avatar { width: 88px; height: 88px; }

.rank-top-name {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

/* 金银铜排名姓名颜色 */
.rank-1 .rank-top-name {
  color: #ffd700; /* 金色 */
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

.rank-2 .rank-top-name {
  color: #c0c0c0; /* 银色 */
  text-shadow: 0 0 8px rgba(192, 192, 192, 0.4);
}

.rank-3 .rank-top-name {
  color: #cd7f32; /* 铜色 */
  text-shadow: 0 0 8px rgba(205, 127, 50, 0.4);
}

.rank-top-score {
  margin-top: 4px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.score-icon {
  font-size: 16px;
  filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.4));
}

.score-number {
  font-size: 14px;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

/* 金银铜排名颜色 */
.rank-1 .score-number {
  color: #ffd700; /* 金色 */
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

.rank-2 .score-number {
  color: #c0c0c0; /* 银色 */
  text-shadow: 0 0 8px rgba(192, 192, 192, 0.4);
}

.rank-3 .score-number {
  color: #cd7f32; /* 铜色 */
  text-shadow: 0 0 8px rgba(205, 127, 50, 0.4);
}

.score-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
  letter-spacing: 0.5px;
}

.rank-badge {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: #1e1e1e;
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}

.rank-1 .rank-badge { background: linear-gradient(90deg, #ffd54f, #ffb300); }
.rank-2 .rank-badge { background: linear-gradient(90deg, #e0e0e0, #bdbdbd); }
.rank-3 .rank-badge { background: linear-gradient(90deg, #ffcc80, #fb8c00); }

.rank-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(161,140,209,0.25);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.rank-item:hover {
  transform: translateY(-2px);
  border-color: rgba(161,140,209,0.5);
  box-shadow: 0 10px 24px rgba(161,140,209,0.28), 0 0 0 6px rgba(161,140,209,0.12);
}

.rank-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rank-index {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(161,140,209,0.25);
  color: var(--dynamic-label-color, #eaeaea);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.rank-1 .rank-index {
  background: linear-gradient(90deg, #ffd54f, #ffb300);
  color: #2b2100;
}
.rank-2 .rank-index {
  background: linear-gradient(90deg, #e0e0e0, #bdbdbd);
  color: #1e1e1e;
}
.rank-3 .rank-index {
  background: linear-gradient(90deg, #ffcc80, #fb8c00);
  color: #2b1400;
}

/* 取消前三名卡片边框与卡片式布局，改为头像居中展示 */

.rank-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: #fff;
}

.rank-name {
  color: var(--dynamic-label-color, #eaeaea);
  font-weight: 600;
  font-size: 14px;
}

.rank-score {
  display: flex;
  align-items: center;
  gap: 4px;
  color: rgba(255,255,255,0.6);
  font-size: 12px;
}

.rank-score .score-icon {
  font-size: 14px;
  filter: drop-shadow(0 0 2px rgba(255, 215, 0, 0.3));
}

.rank-score .score-number {
  font-weight: 600;
  color: rgba(255,255,255,0.8);
}

.month-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px;
  flex: 0 0 auto;
}

.month-item {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(161,140,209,0.25);
  color: var(--dynamic-label-color, #eaeaea);
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
  cursor: pointer;
}

.month-item.active {
  transform: scale(1.12);
  background: linear-gradient(90deg, #a18cd1 0%, #fbc2eb 100%);
  color: #fff;
  box-shadow: 0 4px 10px rgba(161,140,209,0.25);
}

.month-item.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(161,140,209,0.15);
  color: rgba(255, 255, 255, 0.3);
}

.month-item.disabled:hover {
  box-shadow: none;
  transform: none;
  background: rgba(255, 255, 255, 0.04);
}

.month-item:hover:not(.active) {
  box-shadow: 0 6px 16px rgba(161,140,209,0.22);
  transform: translateY(-1px);
}

.lab-middle {
  flex: 1 1 20%;
  padding: 12px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.template-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  perspective: 800px;
}

.lab-right {
  flex: 1 1 10%;
  padding: 12px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.quick-entry {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  gap: 0;
}

.quick-item {
  display: flex;
  flex: 1 1 25%;
  align-items: center;
  justify-content: center;
}

.quick-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(90deg, #a18cd1 0%, #fbc2eb 100%);
  color: #fff;
  font-weight: 600;
  border: 1px solid rgba(161,140,209,0.35);
  box-shadow: 0 6px 16px rgba(161,140,209,0.3), inset 0 0 0 1px rgba(255,255,255,0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  position: relative;
  overflow: hidden;
}

.quick-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 10px 24px rgba(161,140,209,0.45), 0 0 0 6px rgba(161,140,209,0.12);
  filter: saturate(110%);
}

.quick-btn::before {
  content: '';
  position: absolute;
  inset: -20%;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(255,255,255,0.0), rgba(255,255,255,0.6), rgba(255,255,255,0.0) 30%);
  animation: spinRing 3.2s linear infinite;
  pointer-events: none;
  mix-blend-mode: screen;
}

@keyframes spinRing { to { transform: rotate(360deg); } }

.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--dynamic-label-color, #eaeaea);
  margin-bottom: 10px;
}

.section-title::after {
  content: '';
  display: block;
  width: 36px;
  height: 2px;
  margin-top: 6px;
  background: linear-gradient(90deg, #a18cd1 0%, transparent 100%);
  border-radius: 2px;
  opacity: 0.9;
}

.section-title {
  text-shadow: 0 0 18px rgba(161,140,209,0.35);
}

.template-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(161,140,209,0.25);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.template-item:hover {
  transform: translateY(-2px);
  border-color: rgba(161,140,209,0.45);
  box-shadow: 0 10px 24px rgba(161,140,209,0.28);
}

.template-rank {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(90deg, #a18cd1 0%, #fbc2eb 100%);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(161,140,209,0.3);
}

/* 模板排名特殊颜色 */
.template-item:nth-child(1) .template-rank {
  background: linear-gradient(90deg, #ffd54f, #ffb300);
  color: #2b2100;
  box-shadow: 0 4px 10px rgba(255, 181, 0, 0.4);
}

.template-item:nth-child(2) .template-rank {
  background: linear-gradient(90deg, #e0e0e0, #bdbdbd);
  color: #1e1e1e;
  box-shadow: 0 4px 10px rgba(189, 189, 189, 0.4);
}

.template-item:nth-child(3) .template-rank {
  background: linear-gradient(90deg, #ffcc80, #fb8c00);
  color: #2b1400;
  box-shadow: 0 4px 10px rgba(251, 140, 0, 0.4);
}

.template-meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  text-align: right;
  min-width: 0;
  flex: 1;
  margin-left: auto;
}

.template-name {
  font-size: 15px;
  color: var(--dynamic-label-color, #eaeaea);
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  text-align: right;
}

.template-categories {
  display: flex;
  flex-direction: row;
  gap: 8px;
  align-items: center;
  width: 100%;
  justify-content: flex-end;
}

.first-category {
  font-size: 13px;
  color: rgba(255,255,255,0.8);
  font-weight: 500;
  line-height: 1.2;
  text-align: right;
}

.second-category {
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  font-weight: 400;
  line-height: 1.2;
  text-align: right;
}

.template-list {
  perspective: 800px;
}

.template-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
  transition: transform 0.2s ease, filter 0.2s ease;
}

.template-item:hover .template-thumb {
  transform: translateZ(30px) rotateX(3deg) rotateY(-4deg);
  filter: saturate(115%);
}

.lab-header {
  flex: 0 0 auto;
  padding: 20px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.lab-content {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: auto;
  width: 100%;
  scrollbar-width: thin;
  scrollbar-color: rgba(161,140,209,0.25) rgba(255,255,255,0.04);
  background: transparent;
}
.lab-content::-webkit-scrollbar {
  width: 8px;
  background: rgba(255,255,255,0.08);
}
.lab-content::-webkit-scrollbar-thumb {
  background: rgba(161,140,209,0.25);
  border-radius: 6px;
  transition: background 0.3s;
}
.lab-content::-webkit-scrollbar-thumb:hover {
  background: rgba(161,140,209,0.45);
}
.lab-content::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
}

.area-container:hover {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22), inset 0 0 0 1px rgba(255,255,255,0.08);
  border-color: rgba(161,140,209,0.45);
}

.menu-container {
  overflow-y: auto;
}

.center-area, .right-area {
  min-height: 70vh;
}

.menu-container::-webkit-scrollbar {
  width: 6px;
}

.menu-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.menu-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
}

.menu-item {
  margin-bottom: 15px;
}

.parent-menu {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid rgba(161,140,209,0.25);
  color: var(--dynamic-label-color, #eaeaea);
  font-weight: 500;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.parent-menu:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2);
}

.expand-icon {
  transition: transform 0.3s ease;
  color: var(--dynamic-label-color, #eaeaea);
}

.expand-icon.is-expanded {
  transform: rotate(180deg);
}

.child-menu {
  margin-top: 8px;
  padding: 5px;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.child-item {
  padding: 10px 15px;
  margin: 8px 0;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid rgba(161,140,209,0.25);
  color: var(--dynamic-label-color, #eaeaea);
  font-size: 0.95em;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.child-item:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
  border-color: rgba(161,140,209,0.45);
}

.child-item:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.top-section {
  height: 100%;
  /* 其他样式 */
}
.bottom-section {
  height: 100%;
  /* 其他样式 */
}

.lab-header-title {
  text-align: center;
  font-size: 2.1rem;
  font-weight: bold;
  color: var(--dynamic-label-color, #eaeaea);
  margin-bottom: 18px;
  line-height: 1.3;
}
.highlight {
  color: var(--dynamic-label-color, #eaeaea);
  font-weight: 900;
}
.highlight-pic {
  color: #e85aad;
  font-weight: 900;
}
.lab-header-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-bottom: 8px;
}
.lab-btn-main {
  background: linear-gradient(90deg, #a18cd1 0%, #fbc2eb 100%);
  color: #fff;
  border: none;
  border-radius: 18px;
  padding: 6px 22px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  margin-right: 10px;
  box-shadow: 0 6px 18px rgba(161,140,209,0.28);
  transition: background 0.2s, transform 0.2s ease, box-shadow 0.2s ease;
}
.lab-btn-main:hover {
  background: linear-gradient(90deg, #fbc2eb 0%, #a18cd1 100%);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(161,140,209,0.38);
}
.lab-header-tab {
  color: rgba(255,255,255,0.7);
  font-size: 1.05rem;
  margin: 0 6px;
  padding: 2px 8px;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}
.lab-header-tab.active {
  background: linear-gradient(90deg, #a18cd1 0%, #fbc2eb 100%);
  color: #fff;
}
.lab-header-tip {
  text-align: center;
  color: rgba(255,255,255,0.6);
  font-size: 0.98rem;
  margin-top: 2px;
}

/* 美化滚动条样式 */
.lab-content::-webkit-scrollbar,
.left-second-left .rank-list::-webkit-scrollbar,
.left-second-right .rank-list::-webkit-scrollbar,
.template-list::-webkit-scrollbar {
  width: 6px;
  background: transparent;
}

.lab-content::-webkit-scrollbar-thumb,
.left-second-left .rank-list::-webkit-scrollbar-thumb,
.left-second-right .rank-list::-webkit-scrollbar-thumb,
.template-list::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(161,140,209,0.6) 0%, rgba(251,194,235,0.6) 100%);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(161,140,209,0.2);
}

.lab-content::-webkit-scrollbar-thumb:hover,
.left-second-left .rank-list::-webkit-scrollbar-thumb:hover,
.left-second-right .rank-list::-webkit-scrollbar-thumb:hover,
.template-list::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(161,140,209,0.8) 0%, rgba(251,194,235,0.8) 100%);
  box-shadow: 0 4px 12px rgba(161,140,209,0.4);
  transform: scaleX(1.2);
}

.lab-content::-webkit-scrollbar-track,
.left-second-left .rank-list::-webkit-scrollbar-track,
.left-second-right .rank-list::-webkit-scrollbar-track,
.template-list::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.02);
  border-radius: 8px;
  margin: 4px 0;
}

.lab-content::-webkit-scrollbar-corner,
.left-second-left .rank-list::-webkit-scrollbar-corner,
.left-second-right .rank-list::-webkit-scrollbar-corner,
.template-list::-webkit-scrollbar-corner {
  background: transparent;
}

/* Firefox 滚动条样式 */
.lab-content,
.left-second-left .rank-list,
.left-second-right .rank-list,
.template-list {
  scrollbar-width: thin;
  scrollbar-color: rgba(161,140,209,0.6) rgba(255,255,255,0.02);
}

/* 滚动条动画效果 */
@keyframes scrollbarGlow {
  0% { box-shadow: 0 2px 8px rgba(161,140,209,0.2); }
  50% { box-shadow: 0 4px 16px rgba(161,140,209,0.4), 0 0 20px rgba(161,140,209,0.2); }
  100% { box-shadow: 0 2px 8px rgba(161,140,209,0.2); }
}

.lab-content::-webkit-scrollbar-thumb:active,
.left-second-left .rank-list::-webkit-scrollbar-thumb:active,
.left-second-right .rank-list::-webkit-scrollbar-thumb:active,
.template-list::-webkit-scrollbar-thumb:active {
  animation: scrollbarGlow 0.6s ease;
}

/* 皇冠图标样式 */
.crown-icon {
  display: inline-block;
  margin-right: 6px;
  font-size: 16px;
  filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.6));
  animation: crownGlow 2s ease-in-out infinite alternate;
}

.crown-icon.silver {
  filter: drop-shadow(0 0 4px rgba(192, 192, 192, 0.6));
  animation: crownGlowSilver 2s ease-in-out infinite alternate;
}

.crown-icon.bronze {
  filter: drop-shadow(0 0 4px rgba(205, 127, 50, 0.6));
  animation: crownGlowBronze 2s ease-in-out infinite alternate;
}

@keyframes crownGlow {
  0% {
    filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.6));
    transform: scale(1);
  }
  100% {
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.9));
    transform: scale(1.05);
  }
}

@keyframes crownGlowSilver {
  0% {
    filter: drop-shadow(0 0 4px rgba(192, 192, 192, 0.6));
    transform: scale(1);
  }
  100% {
    filter: drop-shadow(0 0 8px rgba(192, 192, 192, 0.9));
    transform: scale(1.05);
  }
}

@keyframes crownGlowBronze {
  0% {
    filter: drop-shadow(0 0 4px rgba(205, 127, 50, 0.6));
    transform: scale(1);
  }
  100% {
    filter: drop-shadow(0 0 8px rgba(205, 127, 50, 0.9));
    transform: scale(1.05);
  }
}

/* 加载状态样式 */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  min-height: 200px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(161,140,209,0.3);
  border-top: 3px solid #a18cd1;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 12px;
}

.loading-text {
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  font-weight: 500;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 无数据状态样式 */
.no-data-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  min-height: 200px;
}

.no-data-text {
  color: rgba(255,255,255,0.5);
  font-size: 14px;
  font-weight: 500;
}

/* 视频预览内容居中样式 */
.video-preview-content {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
  width: 100%;
  padding: 20px;
  box-sizing: border-box;
}

/* 抽屉内容样式 */
.drawer-content {
  padding: 24px;
  height: 100%;
  background: linear-gradient(135deg,
    rgba(161,140,209,0.05) 0%,
    rgba(251,194,235,0.03) 50%,
    rgba(120,214,255,0.05) 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  /* 确保内容区域可以正确计算高度 */
  min-height: 0;
}

.drawer-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(60% 60% at 20% 20%, rgba(161,140,209,0.08) 0%, rgba(161,140,209,0.0) 60%) ,
  radial-gradient(50% 50% at 80% 30%, rgba(251,194,235,0.06) 0%, rgba(251,194,235,0.0) 55%),
  radial-gradient(40% 40% at 50% 80%, rgba(120,214,255,0.04) 0%, rgba(120,214,255,0.0) 60%);
  mix-blend-mode: screen;
  pointer-events: none;
  animation: auroraMove 18s ease-in-out infinite alternate;
}

.data-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  z-index: 1;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  /* 移除固定的 max-height，让 flex 自动计算 */
  /* max-height: calc(100vh - 120px); */
  min-height: 0; /* 确保可以收缩 */
}

.data-item {
  padding: 20px 24px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(161,140,209,0.25);
  border-radius: 16px;
  color: #eaeaea !important;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12),
              0 0 0 1px rgba(255,255,255,0.05),
              inset 0 1px 0 rgba(255,255,255,0.1);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
}

.data-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg,
    rgba(161,140,209,0.1) 0%,
    rgba(251,194,235,0.08) 50%,
    rgba(120,214,255,0.1) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.data-item:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(161,140,209,0.5);
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 16px 48px rgba(161,140,209,0.25),
              0 0 0 1px rgba(255,255,255,0.1),
              inset 0 1px 0 rgba(255,255,255,0.15);
  color: #ffffff !important;
}

.data-item:hover::before {
  opacity: 1;
}

.data-item:active {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 12px 36px rgba(161,140,209,0.2),
              0 0 0 1px rgba(255,255,255,0.08),
              inset 0 1px 0 rgba(255,255,255,0.12);
}

/* 添加序号样式 */
.data-item::after {
  content: counter(item-counter);
  counter-increment: item-counter;
  position: static;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(161,140,209,0.3);
  opacity: 0.8;
  transition: all 0.3s ease;
  flex-shrink: 0;
  margin-left: 16px;
}

.data-item:hover::after {
  opacity: 1;
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(161,140,209,0.4);
}

.data-list {
  counter-reset: item-counter;
}

/* 抽屉标题样式优化 */
:deep(.el-drawer__header) {
  background: linear-gradient(135deg,
    rgba(161,140,209,0.1) 0%,
    rgba(251,194,235,0.08) 100%);
  border-bottom: 1px solid rgba(161,140,209,0.25);
  backdrop-filter: blur(10px);
  padding: 20px 24px;
  margin: 0;
}

:deep(.el-drawer__title) {
  color: #eaeaea !important;
  font-size: 18px;
  font-weight: 700;
  text-shadow: 0 0 12px rgba(161,140,209,0.3);
}

:deep(.el-drawer__close-btn) {
  color: #eaeaea !important;
  font-size: 20px;
  transition: all 0.3s ease;
}

:deep(.el-drawer__close-btn:hover) {
  color: #a18cd1 !important;
  transform: scale(1.1);
}

/* 抽屉主体样式 */
:deep(.el-drawer__body) {
  background: transparent;
  padding: 0;
}

/* 抽屉整体样式 */
:deep(.el-drawer) {
  background: rgba(36, 36, 36, 0.95) !important;
  backdrop-filter: blur(20px);
  border-left: 1px solid rgba(161,140,209,0.25);
}

:deep(.el-drawer.rtl) {
  border-left: none;
  border-right: 1px solid rgba(161,140,209,0.25);
}

/* 滚动条样式 */
.data-list::-webkit-scrollbar {
  width: 8px;
}

.data-list::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(161,140,209,0.6) 0%, rgba(251,194,235,0.6) 100%);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
}

.data-list::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(161,140,209,0.8) 0%, rgba(251,194,235,0.8) 100%);
}

.data-list::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.02);
  border-radius: 8px;
}

/* 空状态样式 */
.data-list:empty::after {
  content: '暂无数据';
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: rgba(255,255,255,0.5);
  font-size: 16px;
  font-weight: 500;
}
</style>
